package com.edu.publisher.service.impl;

import com.edu.publisher.bean.*;
import com.edu.publisher.mapper.TradeStatsMapper;
import com.edu.publisher.service.TradeStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author zcx
 * @create 2022-10-19 20:04
 */
@Service
public class TradeStatsServiceImpl implements TradeStatsService {

    @Autowired
    private TradeStatsMapper tradeStatsMapper;

    @Override
    public BigDecimal getCAU(Integer date) {
        return tradeStatsMapper.selectCAU(date);
    }

    @Override
    public Double getFinalAmount(Integer date) {
        return tradeStatsMapper.selectFinalAmount(date);
    }

    @Override
    public List<TradeStatsBean> getTradeStats(Integer date) {
        return tradeStatsMapper.selectTradeStats(date);
    }

    @Override
    public List<TradeProvinceOrderAmount> getProvinceAmount(Integer date) {
        return tradeStatsMapper.selectProvinceAmount(date);
    }

    //获取某一天各来源的交易额
    @Override
    public List<TradeScFinalAmount> getScFinalAmount(Integer date) {
        return tradeStatsMapper.selectScFinalAmount(date);
    }

    //获取某一天各来源的下单独立用户数
    @Override
    public List<TradeScOdUvCt> getScOdUvCt(Integer date) {
        return tradeStatsMapper.selectScOdUvCt(date);
    }

    //获取某一天各来源的下单次数
    @Override
    public List<TradeScOdCt> getScOdCt(Integer date) {
        return tradeStatsMapper.selectScOdCt(date);
    }

    //获取某一天各来源的下单转化率
    @Override
    public List<TradeScOdPercentConversion> getScOdPeCo(Integer date) {
        return tradeStatsMapper.selectScOdPeCo(date);
    }
}
